package com.yc.store.mapper;

import com.yc.store.bean.Bill;
import com.yc.store.bean.BillItem;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * Company 源辰信息
 *
 * @author navy
 * @date 2024/4/27
 * Email haijunzhou@hnit.edu.cn
 */
@Mapper
//@Repository
public interface BillItemMapper {

    @Select("select count(*) from bill_item where gid=#{gid}")
    int countByGid(int gid);

    @Insert("insert into bill_item values(default,#{bid},#{gid},#{num},#{price})")
    @Options(useGeneratedKeys = true, keyColumn = "id", keyProperty = "id")
    void insert(BillItem billItem);
}
